perm filename DIRBIN[E,ALS] blob
sn#155284 filedate 1975-04-21 generic text, type C, neo UTF8
COMMENT ā VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 Test file to see if it is a reasonable source file
C00004 ENDMK
Cā;
;Test file to see if it is a reasonable source file
NODIR1: ILDB C,H ;Read a character
NODIR2: TLNE G,CTAB(C) ;Is it a special one
JRST NODIR4 ;Yes
NODIR3: SOJG TT,NODIR1 ;Try again
JRST NODIR5 ;Something is wrong
NODIR4: CAIN C,11 ;A TAB here is OK
JRST NODIR3
CAIE C,15 ;Then it must be a CR
JRST NODIR5 ;But it is not
SOJLE TT,NODIR5 ;Have we come to the end?
ILDB C,H ;Get next character after a CR
CAIE C,12 ;It must be a LF
JRST NODIR5 ;But it is not
AOS T ;add 1 to count of CRLF's
CAIL T,4 ;Have we found 4 of them?
JRST NODIR ;Yes so safe to assume text is in ASCII
SOJLE TT,NODIR5 ;At the end yet?
ILDB C,H ;But now what follows?
JUMPN C,NODIR2 ;Not a NULL
CAIL T,3 ;Have we counted 3 CRLF's?
JRST NODIR ;Yes so looks OK
MOVE C,1(H) ;Look for more NULLs,could be a short file
JUMPE C,NODIR ;Will assume that it is
NODIR5: OUTSTR [ASCIZ /
Not a normal source file. /]